﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using SIGReceiver;


namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                textBox2.Text = dlg.FileName;
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //IPEndPoint endpoint = new IPEndPoint(IPAddress.Any, Convert.ToInt32(textBox1.Text));
            //Socket server = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
            //server.Bind(endpoint);
            //IPEndPoint clientend = new IPEndPoint(IPAddress.Any, 0);
            //EndPoint client = (EndPoint)(clientend);

            SelectiveRepeat receiver = new SelectiveRepeat(5555);

            WriteToFile writing = new WriteToFile(textBox2.Text, receiver.receiveData());
            


            //GIS communicate;
            //Send socket to Geoorge's Method


           


        }
    }
}
